home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 19
/
Amiga Format CD19 (1997-10-02)(Future Publishing)(GB)(Track 1 of 5)[!][issue 1997-11].iso
/
-seriously_amiga-
/
shareware
/
misc
/
virtualmem
/
autodocs
/
virtualmem.doc
Wrap
Text File
|
1997-08-18
|
8KB
|
334 lines
TABLE OF CONTENTS
virtualmem.library/AutoAdjustPri
virtualmem.library/ChangeVMemPri
virtualmem.library/CreateVMem
virtualmem.library/FlushVMem
virtualmem.library/GetVMemInfo
virtualmem.library/LockVMem
virtualmem.library/MakeVMem
virtualmem.library/PageIn
virtualmem.library/PageOut
virtualmem.library/RemoveVMem
virtualmem.library/SetVMemFlags
virtualmem.library/UnlockVMem
virtualmem.library/AutoAdjustPri virtualmem.library/AutoAdjustPri
NAME
AutoAdjustPri -- Adjust object priorities (V2)
SYNOPSIS
AutoAdjustPri(array);
a0
VOID AutoAdjustPri(APTR *);
FUNCTION
Automagically adjusts object priorities so that array[42] will get
paged out before array[6]. This call can increase the speed of
programs that process large amounts of data significantly.
INPUTS
array - A NULL-terminated array of object handles
BUGS
For now, you can't pass more than 255 object handles to
AutoAdjustPri().
NOTE
The adjusting code is not quite optimal right now, as it just
distributes the memory objects evenly around 0.
SEE ALSO
ChangeVMemPri
virtualmem.library/ChangeVMemPri virtualmem.library/ChangeVMemPri
NAME
ChangeVMemPri -- Change memory object priority
SYNOPSIS
ChangeVMemPri(handle,newpri);
VOID ChangeVMemPri(APTR,LONG);
a0 d0-0:8
FUNCTION
This function will change the priority of a memory object. The
lower the priority of a memory object is, the sooner it will be
paged out to disk.
INPUTS
handle - A memory object handle
newpri - The new priority for the memory object
SEE ALSO
CreateVMem
virtualmem.library/CreateVMem virtualmem.library/CreateVMem
NAME
CreateVMem -- Create a memory object
SYNOPSIS
handle = CreateVMem(size,flags,priority,virtualflags);
d0 d0 d1 d2 d3
APTR CreateVMem(ULONG,ULONG,BYTE,ULONG);
FUNCTION
Creates a memory object.
INPUTS
size - Size of the requested memory block
flags - Memory flags as with most exec.library memory allocation
functions
priority - The initial priority for the memory object
virtualflags - Additional flags
RETURN
A pointer to a memory object handle. The structure for this object
is private as it is subject to change in the future.
SEE ALSO
RemoveVMem, LockVMem, UnlockVMem, libraries/virtualmem.h
virtualmem.library/FlushVMem virtualmem.library/FlushVMem
NAME
FlushVMem -- Page a memory object to disk
SYNOPSIS
success = FlushVMem(attrs);
d1
BOOL FlushVMem(ULONG);
FUNCTION
Ask virtualmem.library to page one memory object to disk. The
function will page the low-priority objects not belonging to the
calling task to disk first.
INPUTS
attrs - Memory attributes
RESULT
success - TRUE if a memory object was paged out, FALSE otherwise
NOTE
This function was implemented mainly for the AllocMem() patch to
allow non-virtualmem.library tasks to run in relative harmony with
those that use virtualmem.library.
virtualmem.library/GetVMemInfo virtualmem.library/GetVMemInfo
NAME
GetVMemInfo -- Get information about objects
SYNOPSIS
GetVMemInfo(info);
a0
VOID GetVMemInfo(struct VMemStat *);
FUNCTION
Gather information about memory objects and fill a given structure
with it. This function is relatively slow when lots of objects have
been created as it has to walk down the list of memory objects.
INPUTS
info - A pointer to a VMemStat structure
virtualmem.library/LockVMem virtualmem.library/LockVMem
NAME
LockVMem -- Lock a memory object into memory
SYNOPSIS
memory = LockVMem(handle);
d0 a0
APTR LockVMem(APTR);
FUNCTION
Locks a memory object into RAM and returns a pointer to it. This
memory can then be used like conventional memory.
INPUTS
handle - The memory handle as given to you by CreateVMem
RETURN
memory - A pointer to the memory area the object controls
NOTE
You should, in general, keep as little memory blocks locked at the
same time. This way, if a non-virtualmem.library task needs more
memory, virtualmem.library can page some low-priority objects to
disk.
All succesful calls to LockVMem should have matching calls to
UnlockVMem()!
SEE ALSO
UnlockVMem
virtualmem.library/MakeVMem virtualmem.library/MakeVMem
NAME
MakeVMem -- Turn a memory block into a memory object
SYNOPSIS
handle = MakeVMem(memory,size,flags,virtualflags);
d0 a0 d0 d1 d3
APTR MakeVMem(APTR,ULONG,ULONG,ULONG);
FUNCTION
Create a memory object and place the memory block into its control.
The memory area must have been allocated with AllocMem(),
AllocVec() will not do. After the function is called, all pointers to
the memory become invalid. The resulting memory object will be unlocked.
INPUTS
memory - The memory area to convert
size - Size in bytes
flags - Set of bits as given to CreateVMem()
virtualflags - Set of bits as given to CreateVMem()
RETURN
handle - A memory object handle or NULL if failed
NOTE
You must not FreeMem() the memory area yourself! It is now a memory
object and must be freed with RemoveVMem()!
SEE ALSO
ChangeVMemPri, CreateVMem, RemoveVMem
virtualmem.library/PageIn virtualmem.library/PageIn
NAME
PageIn -- Load a memory object back into RAM
SYNOPSIS
success = PageIn(handle);
a0
BOOL PageIn(APTR);
FUNCTION
Loads a memory object back to RAM from disk if it has been paged
out.
INPUTS
handle - The memory object handle
RETURN
success - TRUE if read was successful, FALSE otherwise
NOTE
As this function wasn't originally meant to be used by programs
other than virtualmem.library, you shouldn't use it.
SEE ALSO
PageOut
virtualmem.library/PageOut virtualmem.library/PageOut
NAME
PageOut -- Page a memory object to disk
SYNOPSIS
success = PageOut(handle);
a0
BOOL PageOut(APTR);
FUNCTION
Pages a memory object to disk if not there already.
INPUTS
handle - The memory object handle
RETURN
success - TRUE if write was successful, FALSE otherwise
NOTE
As this function wasn't originally meant to be used by programs
other than virtualmem.library, you shouldn't use it.
SEE ALSO
PageIn, LockVMem
virtualmem.library/RemoveVMem virtualmem.library/RemoveVMem
NAME
RemoveVMem -- Remove a memory object
SYNOPSIS
RemoveVMem(handle);
a0
VOID RemoveVMem(APTR);
FUNCTION
Removes a memory object previously allocated with CreateVMem().
The memory object must be unlocked.
INPUTS
handle - The memory object you wish to get rid of
SEE ALSO
CreateVMem()
virtualmem.library/SetVMemFlags virtualmem.library/SetVMemFlags
NAME
SetVMemFlags -- Set user-definable flags (V3)
SYNOPSIS
oldflags = SetVMemFlags(handle, newflags);
a0 d0
ULONG SetVMemFlags(APTR,ULONG);
FUNCTION
Sets the user-definable flags in a memory object.
INPUTS
handle - a memory object handle
newflags - the new flags
RESULT
oldflags - the old flags that just got replaced
NOTE
You can't set some of the flags after a memory object is created.
You should be able to set all defined flags for now; this may
change in the future, however.
SEE ALSO
CreateVMem, MakeVMem
virtualmem.library/UnlockVMem virtualmem.library/UnlockVMem
NAME
UnlockVMem -- Unlock a memory object
SYNOPSIS
UnlockVMem(handle);
a0
VOID UnlockVMem(APTR);
FUNCTION
Unlocks a memory object. All pointers to the memory obtained with
LockVMem() from this object become invalid.
INPUTS
handle - The memory object handle
SEE ALSO
LockVMem